home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 2371 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: norconnect.no!not-for-mail
  2. From: kenneth@norconnect.no (Kenneth C. Nilsen)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Removing a patch -A POSSIBLE SOULTION
  5. Date: 30 Jan 1996 19:52:40 +0100
  6. Organization: NorConnect Internet Services AS
  7. Message-ID: <1224.6603T1039T2442@norconnect.no>
  8. References: <1996Jan29.141204.23597@ludens> <2650.6603T32T2733@norconnect.no>
  9. NNTP-Posting-Host: norconnect.no
  10. X-Newsreader: THOR 2.21 (Amiga;SOUP)
  11.  
  12. >Your patch need something like this:
  13. >Not in use -> Forbid() -> Remove -> Compare new pointer ->
  14. >Is it the same as the pointer to your code when you installed your patch?
  15. >    no  -> reinstall/enable() and wait/retry/prompt
  16. >    yes -> remove/enable()
  17.  
  18. Hi again. My small greys have though all night so here is another possible
  19. checking routine before removing a patch:
  20.  
  21. Lets say we patched intuition.library/OpenScreen()
  22.  
  23.     [bla bla..install patch etc...bla bla]
  24.  
  25.     (We want to remove the patch..) :
  26.     bsr.b    Check
  27.  
  28.     [bla bla]
  29.  
  30.  
  31. Check:    move.l    $4.w,a6                ;exec base
  32.     Call    Forbid
  33.  
  34.     move.l    IntuitionBase(pc),a1
  35.     move.l    _LVOOpenScreen(a1),d0    ;current pointer to function
  36.     move.l    #Patch,d1        ;our patch
  37.     cmp.l    d0,d1
  38.     beq.b    .okRemove    ;it's our patch level: we can remove it
  39.  
  40.     Call    Permit
  41.     rts            ;don't remove patch!!
  42.  
  43. .okRemove
  44.                     ;we have IntBase in a1 from check
  45.     move.l    d0,a0            ;we have _LVOOpe.. in d0 from check
  46.     move.l    OldFunc(pc),d0
  47.     Call    SetFunction
  48.  
  49.     Call    Permit
  50.     rts
  51.  
  52.  
  53. Patch:    (Our Patch Routine)
  54.  
  55.     [bla bla]
  56.  
  57.  
  58. ---
  59. CREATIVE LINKS                       __     Kenneth C. Nilsen
  60. http://www.norconnect.no/~kenneth   /_/\    e-mail: kenneth@norconnect.no
  61. "Everything you want"               \_\/    Software & MultiMedia developer
  62.